<table class="table table-hover">
    <tr>
        <th style="border:none;">缩略图</th>
        <th style="border:none;">ID</th>
        <th style="border:none;">标题</th>
        <th style="border:none;">描述</th>
        <th style="border:none;">发布时间</th>
        <th style="border:none;">点赞数量</th>
        <th style="border:none;">阅读数量</th>
        <th style="border:none;">评论数量</th>
        <th style="border:none;">操作</th>
    </tr>
    <?php foreach($data as $v):?>
    <tr>
        <td><img src="<?php echo cutUrl($v['thumb'],80,40)?>" alt=""></td>
        <td style="line-height: 40px"><?php echo $v['id']?></td>
        <td style="line-height: 40px"><?php echo str_cut($v['title'],50,'...')?></td>
        <td style="line-height: 40px"><?php echo str_cut($v['description'],50,'...')?></td>
        <td style="line-height: 40px"><?php echo $v['create_time']?></td>
        <td style="line-height: 40px"><?php echo $v['likes']?></td>
        <td style="line-height: 40px"><?php echo $v['views']?></td>
        <td style="line-height: 40px"><?php echo $v['comment']?></td>
        <td data-id="<?php echo $v['id']?>">

            <a href="javascript:;" class="btn btn-default btn-xs update radius-none">编辑</a>
            <a href="javascript:;" class="btn btn-success btn-xs look-comment radius-none">查看评论</a>

        </td>
    </tr>
    <?php endforeach;?>
</table>
<div role="group" data-total="<?php echo $total?>" data-page="<?php echo $page?>" data-nums="<?php echo $nums?>" data-src="<?php echo U('Admin/Special/Index/lists');?>"  class="btn-group" id="_pages"></div>
<script>


    $(function(){



        Admin.pages();

        $('.update').unbind('click');
        $('.update').click(function(){

            var id = $(this).parent().data('id');
            var page = '<?php echo $page?>';

            showMessage('','','<?php echo U("Admin/Special/Index/update")?>',{'id':id,'page':page});


        });

        //查看评论
        $('.look-comment').unbind('click');
        $('.look-comment').click(function(){

            var id = $(this).parent().data('id');

            var lay = layer.load();

            $.post('<?php echo U("Admin/Special/Index/commentLists")?>',{'id':id},function(result){

                layer.close(lay);

                if(typeof result == 'object' && result.code == 300){

                    showMessage(result.msg,result.code,'','',2000);

                    return false;

                }

                layer.open({

                    type: 1,
                    area: ['100%', '100%'],
                    content: result,

                });

            });



        });

    })


</script>
